﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true" CodeFile="ListPackage.aspx.cs" Inherits="Admin_Package_ListPackage" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server">
    <style type="text/css">
        .lblWrap
        {
            width: 100px;
            text-overflow: ellipsis;
            white-space: nowrap;
            display: block;
            overflow: hidden;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <asp:UpdatePanel ID="up1" runat="server">
        <ContentTemplate>
            <div style="text-align: center;">
                <h1>Package Management</h1>
                <asp:Label ID="Label1" runat="server" Text="Package Barcode:"></asp:Label>
                <asp:TextBox ID="txtBarcode" runat="server" AutoPostBack="True" Width="496px" OnTextChanged="txtBarcode_TextChanged"></asp:TextBox>
                <asp:Button ID="btnCheck" runat="server" Text="Search" OnClick="btnCheck_Click" />
                <br />
                <br />
                <asp:Label ID="lblError" runat="server" ForeColor="Red" Text=""></asp:Label>
            </div>
            <hr />
            <div runat="server">
                <asp:Label ID="lblDate" runat="server" Text="Date:"></asp:Label>
                <asp:TextBox ID="txtSearchDate" runat="server"></asp:TextBox>
                <asp:CalendarExtender ID="txtSearchDate_CalendarExtender" runat="server" Enabled="True" TargetControlID="txtSearchDate" TodaysDateFormat="dd-MMM-yyyy">
                </asp:CalendarExtender>
                <asp:Button ID="btnFilter" runat="server" Text="Filter" OnClick="btnFilter_Click" />
            </div>
            <div>
                <br />
            </div>
            <asp:GridView ID="gvPackage" runat="server" AutoGenerateColumns="False" CellPadding="4" ForeColor="#333333" GridLines="None" Width="100%">
                <AlternatingRowStyle BackColor="White" />
                <Columns>
                    <asp:BoundField HeaderText="ID" DataField="ID" />
                    <asp:BoundField HeaderText="Sender" DataField="Sender" />
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:Label ID="lblFrom" Width="300px" ToolTip='<%# Eval("SenderLocation") %>' runat="server" Text='<%# Eval("SenderLocation") %>' CssClass="lblWrap"></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField HeaderText="Receiver" DataField="Receiver" />
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:Label ID="lblFrom" Width="300px" ToolTip='<%# Eval("ReceiverLocation") %>' runat="server" Text='<%# Eval("ReceiverLocation") %>' CssClass="lblWrap"></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField HeaderText="Date" DataField="PackageDate" DataFormatString="{0:dd-MMM-yy}" ItemStyle-Width="80px" />
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:HyperLink ID="linkEdit" runat="server" Text="Edit" NavigateUrl='<%# String.Format("~/Admin/Package/EditPackage.aspx?barcode={0}",Eval("barcode")) %>'></asp:HyperLink>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <%--  <asp:TemplateField>
                <ItemTemplate>
                    <asp:HyperLink ID="linkEditRoute" runat="server" Text="Edit Route" NavigateUrl='<%# String.Format("~/Admin/Package/EditRoute.aspx?barcode={0}",Eval("barcode")) %>'></asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>--%>
                </Columns>
                <EditRowStyle BackColor="#2461BF" />
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#EFF3FB" />
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                <SortedAscendingCellStyle BackColor="#F5F7FB" />
                <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                <SortedDescendingCellStyle BackColor="#E9EBEF" />
                <SortedDescendingHeaderStyle BackColor="#4870BE" />
            </asp:GridView>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

